function navOpen(click) {

}


function realTimeSearch(e) {
    if ($(this).val() == '') {
        return;
    }
    if (e.keyCode == "13") {
        console.log('回车');
        return;
    }
    console.log($(this).val());
}








function setSearchList(arr) {

    $.ajax({
        url:"/index/search/searchRan",
        success:function(res){
            $('.search .search_list').html('');
            $('.search .search_list').show();
            $('.search .input .host_search').show();
            res.rankings.forEach(function (item) {
                $('.search .search_list').append('<span><b>' + item.text + '</b><i>' + item.num + '条结果</i></span>');
            });
        }
    });
}

function jumpSearch() {
    if($('.search .input input').val() == '') {
        $('.search .input .tip').html('搜索词不能为空');
        $('.search .input .tip').fadeIn();
        setTimeout(function () {
            $('.search .input .tip').fadeOut(100);
            setTimeout(function(){
                $('.search .input .tip').html('');
            },100);
        }, 1500);
        return;
    }
    
    var opt = {
        value:$('.search .input input').val(),
        type:parseInt($('.search .input .select .value').attr('value'))
    }

    $.ajax({
        url:"/index/search/index",
        type:"post",
        data:opt,
        success:function(res){
            console.log(res.url)
            window.location = res.url;
        }
    });
    console.log(opt);
    
}